
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<base href="<%=basePath%>">

		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>ExamStack</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<link rel="shortcut icon" href="<%=basePath%>resources/images/favicon.ico" />
		<link href="resources/bootstrap/css/bootstrap-huan.css" rel="stylesheet">
		<link href="resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
		<link href="resources/css/exam.css" rel="stylesheet" type="text/css">
		<link href="resources/css/style.css" rel="stylesheet">
		
		<style type="text/css">
			.question-body {
				padding: 30px 30px 20px 30px;
				background: #FFF;
			}
			
			ul#exampaper-body{
				margin-bottom: 0px;
			}
			
			ul#exampaper-body li{
				padding-bottom:0px;
			}
			.question-body{
				min-height:300px;
			}
			
		</style>
	</head>
	<body>
		<header>
			<div class="container" >
				<div class="row">
                <div class="col-xs-5">
                    <div class="logo">
                        <h1><a href="#"><img alt="" src="resources/images/logo.png"></a></h1>
                    </div>
                </div>
                <div class="col-xs-7" id="login-info">
				<#--<c:choose>-->
				<#--<c:when test="${not empty sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}">-->
				<#--<div id="login-info-user">-->

				<#--<a href="user-detail/${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}" id="system-info-account" target="_blank">${sessionScope.SPRING_SECURITY_CONTEXT.authentication.principal.username}</a>-->
				<#--<span>|</span>-->
				<#--<a href="j_spring_security_logout"><i class="fa fa-sign-out"></i> 退出</a>-->
				<#--</div>-->
				<#--</c:when>-->
				<#--<c:otherwise>-->
				<#--<a class="btn btn-primary" href="user-register">用户注册</a>-->
				<#--<a class="btn btn-success" href="user-login-page">登录</a>-->
				<#--</c:otherwise>-->
				<#--</c:choose>-->
                </div>
            </div>
			</div>
		</header>
		<!-- Navigation bar starts -->

		<div class="navbar bs-docs-nav" role="banner">
			<div class="container">
				<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
					<ul class="nav navbar-nav">
						<li>
							<a href="/user/home"><i class="fa fa-home"></i>主页</a>
						</li>
						<li>
							<a href="/user/intopractice"><i class="fa fa-edit"></i>试题练习</a>
						</li>
						<li>
							<a href="/user/exam"><i class="fa  fa-paper-plane-o"></i>在线考试</a>
						</li>

						<li>
							<a href="/intousercenter"><i class="fa fa-dashboard"></i>会员中心</a>
						</li>
						<li>
							<a href="/update"><i class="fa fa-cogs"></i>个人设置</a>
						</li>
					</ul>
				</nav>
			</div>
		</div>

		<!-- Navigation bar ends -->

		<div class="content" style="margin-bottom: 100px;">

			<div class="container" id="app">
				<div class="row">
					<div class="col-xs-3" style="padding-right: 0px;padding-bottom:15px;">
						<div class="def-bk" id="bk-exam-control">

							<div class="def-bk-content" id="exam-control">

								<div>

									<span style="color:#428bca;">知识类型：</span>
									<div>
										<span>{{result.fname}}</span>
									</div>
									<span style="color:#428bca;">题型库：</span>
									<div>
										<span id="practice-type" class="pt-singlechoice">{{result.qyname}}[ 共 <span class="pt-tno">{{result.allPage}}</span> 题 ]<span class="pt-qcode" style="display:none;">qt-singlechoice</span></span>
									</div>

									<span id="exam-timestamp" style="display:none;">0</span>
									<div id="answer-save-info"></div>
								</div>
								<div id="question-submit">
									<button class="btn-success btn" style="width:100%;" id="switch-model-btn" data-exam="true">
										答题模式
									</button>
								</div>
								<div id="exam-info" style="display:none;">
									<span id="answer-hashcode"></span>
								</div>
							</div>

						</div>

					</div>
					<div class="col-xs-9" style="padding-right: 0px;">
						<div class="def-bk" id="bk-exampaper" style="margin-left: 30px">
							<#--==============================分割线=======================================-->
							<div class="expand-bk-content" id="bk-conent-exampaper">
								<div id="exampaper-header">
									<div id="exampaper-title"  style="margin-bottom:15px;">
										<i class="fa fa-paper-plane"></i>
										<span id="exampaper-title-name"> {{result.fname}} - {{result.qyname}}</span>
									</div>
								</div>
								<ul style="margin-left: 30px;" id="exampaper-body1" v-for="item in result2">
								题目： {{item.name}}<br>
                                    <div  v-if="result.qyname==='判断题'"  >
                                           <p><input type="radio"   class="panduanRedio" name="panduan" v-bind:value="'T,'+item.id">&nbsp正确</p>
                                            <p><input type="radio"   class="panduanRedio" name="panduan" v-bind:value="'F,'+item.id">&nbsp错误</p>
                                           <button  class="btn btn-primary" @click="panduan()">提交</button>
                                    </div>
                                    <div v-else>
											<p> <input type="radio" name="xuanze" v-bind:value="'A,'+item.id">&nbspA:{{item.a}}</p>
											<p> <input type="radio" name="xuanze" v-bind:value="'B,'+item.id">&nbspB:{{item.b}}</p>
											<p> <input type="radio" name="xuanze" v-bind:value="'C,'+item.id">&nbspC:{{item.c}}</p>
											<p> <input type="radio" name="xuanze" v-bind:value="'D,'+item.id">&nbspD:{{item.d}}</p>
                                        <button  class="btn btn-primary" @click="xuanze()">提交</button>
                                    </div>
								</ul>
                                <ul style="margin-left: 30px; display: none;" id="exampaper-body2" v-for="item in result2">
                                    题目： {{item.name}}<br>
                                    <div  v-if="result.qyname==='判断题'">
                                        <p><input type="radio"   class="panduanRedio" name="panduan" v-bind:value="'T,'+item.id">&nbsp正确</p>
                                        <p><input type="radio"   class="panduanRedio" name="panduan" v-bind:value="'F,'+item.id">&nbsp错误</p>
                                        <p id="answer" v-bind:answer="item.answer">正确答案：{{item.answer}}</p>
                                        <p>解析为：</p>
                                        <p>{{item.analysis}}</p>
                                    </div>
                                    <div v-else>
                                        <p> <input type="radio" name="xuanze" v-bind:value="'A,'+item.id">&nbspA:{{item.a}}</p>
                                        <p> <input type="radio" name="xuanze" v-bind:value="'B,'+item.id">&nbspB:{{item.b}}</p>
                                        <p> <input type="radio" name="xuanze" v-bind:value="'C,'+item.id">&nbspC:{{item.c}}</p>
                                        <p> <input type="radio" name="xuanze" v-bind:value="'D,'+item.id">&nbspD:{{item.d}}</p>
                                        <p id="answer1" v-bind:answer="item.answer">正确答案：{{item.answer}}</p>
                                        <p>解析为：</p>
                                        <p>{{item.analysis}}</p>
                                    </div>
                                </ul>
								<div style="margin-left: 30px" id="pagenav">

								</div>
							</div>
							<#--=========================分割线=======================================================-->
							<div class="expand-bk-content" id="bk-conent-comment" style="margin-top:40px;display:none;">
								<div id="comment-title" style="margin-bottom:15px;">
									<i class="fa fa-comments"></i>
									<span> 学员评论 </span>

								</div>
								<ul class="comment-list">
									
									<li class="comment-list-item">
										<div class="comment-user-container">
											<div >
												<img src="resources/images/photo.jpg" class="comment-user-img">
											</div>
											<div class="comment-user-info">
												<div>
													yanhuan [电能计量]
												</div>
												<div class="comment-date">
													发表于 1天前
												</div>
											</div>
										</div>
										<p class="comment-user-text">
											应该选B不是吗？
										</p>
									</li>
									<li class="comment-list-item">
										<div class="comment-user-container">
											<div >
												<img src="resources/images/photo.jpg" class="comment-user-img">
											</div>
											<div class="comment-user-info">
												<div>
													yanhuan [电能计量]
												</div>
												<div class="comment-date">
													发表于 1天前
												</div>
											</div>
										</div>
										<p class="comment-user-text">
											应该选B不是吗？
										</p>
										
									</li>
								</ul>
								<div>
									<input type="hidden" id="idx_hidden" value="1">
									<button id="show_more_btn">更多评论</button>
								</div>
								<form class="comment-form">
									<textarea rows="" cols="" style="width:100%;height:95px;"></textarea>
									<input class="btn btn-primary" type="submit" value="发表评论">
								</form>
								
							</div>
						</div>

					</div>
				</div>
			</div>

		</div>
		<footer>
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="copy">
							<p>
								ExamStack Copyright © <a href="http://www.examstack.com/" target="_blank">ExamStack</a> - <a href="resources" target="_blank">主页</a> | <a href="http://www.examstack.com/" target="_blank">关于我们</a> | <a href="http://www.examstack.com/" target="_blank">FAQ</a> | <a href="http://www.examstack.com/" target="_blank">联系我们</a>
							</p>
						</div>
					</div>
				</div>

			</div>

		</footer>

		<!-- Slider Ends -->

		<!-- Javascript files -->
		<!-- jQuery -->
		<script type="text/javascript" src="resources/js/jquery/jquery-1.9.0.min.js"></script>
		<!-- Bootstrap JS -->
		<script type="text/javascript" src="resources/bootstrap/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="resources/js/all.js?v=0712"></script>
		<script type="text/javascript" src="resources/js/practice-improve.js"></script>
        <script src="../../static/js/vue/vue.min.js"></script>
        <script src="../../static/js/layer/layer.js"></script>
	    <script src="../../static/js/laypage/laypage.js"></script>

	</body>
</html>

<script>

    var vm = new Vue({
        el:'#app',
        data:{
            result:{},
            result2:[]
        }
    });

    var begin =function(curr){
        $.ajax({
            url:'/practiceimprovedetail',
            type:"POST",
            data:{
                curr:curr||1,
                perTotle:1
            },
            success:function (data) {
                vm.result = data;
                vm.result2=data.page.list;
                console.log(data);
                console.log(data.page.list);
                laypage({
                    cont:'pagenav',
                    pages:data.allPage,//这个是总页数
                    first:'第一题',
                    last:'最后一题',
                    curr:curr || 1,
                    jump:function(obj,first){
                        if(!first){
                            begin(obj.curr);
                        }
                    }
                })
            }
        })
	};
	begin();


    //这个是判断题
    var panduan = function () {
        var ss =   $('input[name="panduan"]:checked').val();
        var kk=$("#answer").attr("answer");
        alert("正确答案："+kk);
         $.ajax({
            type : 'post',/* //提交方式*/
            url : "/usersavepractice",/* //路径*/
            dataType : "json",
            data:{
                data1 : ss
            },
            /*   //返回普通的字符流不要写 dataType : "json"*/
            success : function(data) {
                vm.resultss=data;
            }
        });
    };
    //这个是选择题
    var xuanze = function () {
        var ss =   $('input[name="xuanze"]:checked').val();
        var kk=$("#answer1").attr("answer");
        alert("正确答案："+kk);
        $.ajax({
            type : 'post',/* //提交方式*/
            url : "/usersavepractice",/* //路径*/
            dataType : "json",
            data:{
                data1 : ss
            },
            /*   //返回普通的字符流不要写 dataType : "json"*/
            success : function(data) {
                vm.resultss=data;
            }
        });
    };


    //控制答题与背题的来回切换
    $(function () {
        //alert("aaaaaaaaa");
        //$("#exampaper-body1").css('display','none');//隐藏


    var flag = true;
    $("#switch-model-btn").click(function () {
        if (flag) {
            $("#exampaper-body1").css('display','none');//隐藏
            $("#exampaper-body2").css('display','inline');//显示
            flag=false;
        }else {
            $("#exampaper-body2").css('display','none');//隐藏
            $("#exampaper-body1").css('display','inline');//显示
            flag=true;
        }

    })
    });
</script>